<style lang="less" scoped>
.layout {
  border: 0px solid #d7dde4;
  background: #f5f7f9;
  position: relative;
  border-radius: 4px;
  // overflow: hidden;
  // height: 100vh;
}
.layout-header-bar {
  background: #fff;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
}

.menu-icon {
  transition: all 0.3s;
}
.rotate-icon {
  transform: rotate(-90deg);
}
.menu-item span {
  display: inline-block;
  overflow: hidden;
  width: 69px;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  transition: width 0.2s ease 0.2s;
}
.menu-item i {
  transform: translateX(0px);
  transition: font-size 0.2s ease, transform 0.2s ease;
  vertical-align: middle;
  font-size: 16px;
}
.collapsed-menu span {
  width: 0px;
  transition: width 0.2s ease;
}
.collapsed-menu i {
  transform: translateX(5px);
  transition: font-size 0.2s ease 0.2s, transform 0.2s ease 0.2s;
  vertical-align: middle;
  font-size: 22px;
}
.demo-Circle-custom {
  & h1 {
    color: #3f414d;
    font-size: 28px;
    font-weight: normal;
  }
  & p {
    color: #657180;
    font-size: 14px;
    margin: 10px 0 15px;
  }
  & span {
    display: block;
    padding-top: 15px;
    color: #657180;
    font-size: 14px;
    &:before {
      content: "";
      display: block;
      width: 50px;
      height: 1px;
      margin: 0 auto;
      background: #e0e3e6;
      position: relative;
      top: -15px;
    }
  }
  & span i {
    font-style: normal;
    color: #3f414d;
  }
}
</style>
<template>
  <div class="layout">
    <Layout>
      <!-- <h1 style="text-align:center;background: '#fff'">BBP需求管理平台</h1> -->
    </Layout>
    <Layout>
      <Sider
        ref="side1"
        hide-trigger
        collapsible
        :collapsed-width="78"
        v-model="isCollapsed"
        :style="{
          background: '#fff',
          'box-shadow': '0 5px 5px rgba(0,0,0,.1)',
        }"
      >
        <Menu
          :active-name="currentTabComponent"
          width="auto"
          :class="menuitemClasses"
          @on-select="menuSelect"
        >
          <MenuItem name="index">
            <Icon type="ios-navigate"></Icon>
            <span>首页</span>
          </MenuItem>
          <MenuItem name="brSign">
            <Icon type="ios-search"></Icon>
            <span>需求管理</span>
          </MenuItem>
          <MenuItem name="brAdmin">
            <Icon type="ios-settings"></Icon>
            <span>月版管理</span>
          </MenuItem>
          <MenuItem name="errAdmin">
            <Icon type="ios-settings"></Icon>
            <span>事件管理</span>
          </MenuItem>
          <MenuItem name="helper">
            <Icon type="ios-settings"></Icon>
            <span>常用功能</span>
          </MenuItem>
        </Menu>
      </Sider>

      <!-- 此处调节内容布局 -->
      <Layout >
        <Header :style="{ padding: 0 ,height:'7vh'}" class="layout-header-bar">
          <Icon
            @click.native="collapsedSider"
            :class="rotateIcon"
            :style="{ margin: '0 1vhpx' }"
            type="md-menu"
            size="24"
          ></Icon>
          BBP需求管理平台
        </Header>

        <Content
          :style="{ margin: '8px', background: '#fff', minHeight: '91vh' }"
        >
        <div>
                    <keep-alive>
            <component v-bind:is="currentTabComponent"></component>
          </keep-alive>
        </div>
        </Content>
      </Layout>
    </Layout>
  </div>
</template>
<script>
import index from "./Index/Index";
import brSign from "./Index/brSign";
import brAdmin from "./Index/brAdmin";
import errAdmin from "./Index/errAdmin"
import helper from "./Index/helper"
export default {
  data() {
    return {
      isCollapsed: false,
      currentTabComponent: "index",
    };
  },
  computed: {
    rotateIcon() {
      return ["menu-icon", this.isCollapsed ? "rotate-icon" : ""];
    },
    menuitemClasses() {
      return ["menu-item", this.isCollapsed ? "collapsed-menu" : ""];
    },
  },
  methods: {
    collapsedSider() {
      this.$refs.side1.toggleCollapse();
    },
    menuSelect(name) {
      console.log(name);
      this.currentTabComponent = name;
    },
  },
  components: {
    index,
    brSign,
    brAdmin,
    errAdmin,
    helper
  },
};
</script>